package com.emns.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emns.dao.TestMapper;
import com.emns.pojo.Test;
import com.emns.pojo.TestExample;

@Service
public class TestService {

	@Autowired
	TestMapper tm;
	
	//查询所有测试数据
	public List<Test> queryAll(){
		TestExample te = new TestExample();
		List<Test> testArr = tm.selectByExample(te); 
		return testArr;
	}
	
	//添加测试数据
	public void insert(Test test){
		tm.insert(test);
	}
	
	//更新测试数据
	public void update(Test test){
		tm.updateByPrimaryKey(test);
	}
	
	//删除测试数据
	public void delete(int id){
		tm.deleteByPrimaryKey(id);
	}
	
}
